package rxjava.application.com.androidmyp.Home;

import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.LinearInterpolator;

/**
 * Created by Administrator on 2016/3/9.
 * 自定义
 */
public class DefineInteplorator extends LinearInterpolator {
    private float factor;
    public DefineInteplorator() {
        this.factor = 0.15f;
    }

    public DefineInteplorator(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public float getInterpolation(float input) {
        return (float) (Math.pow(2, -10 * input) * Math.sin((input - factor / 4) * (2 * Math.PI) / factor) + 1);
    }
}

